package cn.kgc.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 课工场
 * @date 2024/7/20
 * @description
 */
@Configuration
public class BeansConfig {

    @Bean
    @LoadBalanced  //  扩展restTemplate的负载均衡
    public RestTemplate restTemplate(){
        RestTemplate restTemplate = new RestTemplate();
        return  restTemplate;
    }
}
